package com.kmu.wmy.controller;
import com.kmu.wmy.dao.LoginDao;
import com.kmu.wmy.dao.impl.LoginDaoImpl;
import com.kmu.wmy.entity.LoginDetail;
import com.opensymphony.xwork2.ActionSupport;

public class LoginController extends ActionSupport {
    private LoginDetail loginDetail;

    public LoginDetail getLoginDetail() {
        return loginDetail;
    }

    public void setLoginDetail(LoginDetail loginDetail) {
        this.loginDetail = loginDetail;
    }
//    执行方法
    @Override
    public String execute() throws Exception {
        LoginDao loginDao = new LoginDaoImpl();
        LoginDetail ld = loginDao.validateUserInfo(loginDetail.getStudentNo(), loginDetail.getToken());
        if (ld != null) {
            return "success";
        } else {
            return "error";
        }
    }
}
